package com.w2cx.selenium.page;

import com.w2cx.selenium.base.DriverBase;
import com.w2cx.selenium.util.Locator;
import org.openqa.selenium.WebElement;

import java.util.List;

public class MarkCategoryManagePage extends BasePage{
    DriverBase driver;
    public  MarkCategoryManagePage( DriverBase driver){
        super(driver);
    }


    //获取“基础数据管理”菜单
    public WebElement getBaseDataManageMenu(){
        List<WebElement> list = elements(Locator.getByLocator("firstMenuList"));
        WebElement element = list.get(3);
        System.out.println("找到元素:"+element.getText());
        return element;
    }

    //获取“标签分类管理”菜单
    public WebElement getMarkCategoryManageMenu(){
        List<WebElement> list = elements(Locator.getByLocator("BaseDataSecondMenu"));
        WebElement element = list.get(0);
        System.out.println("找到元素:"+element.getText());
        return element;
    }


    //获取“添加”按钮
        public WebElement getMarkCategoryAddBtn(){
            List<WebElement> list =   elements(Locator.getByLocator("markCategoryBtn"));
            WebElement addBtn = list.get(0);
            return addBtn;
        }



        //获取“分类名称”输入框
        public WebElement getCategoryNameInput(){
            WebElement element = element(Locator.getByLocator("categoryNameInput"));
            return  element;
        }

        //获取“上级分类”输入框
        /*public WebElement getHigherCategoryInput(){
            WebElement element = element(Locator.getByLocator("higherCategoryInput"));
            return element;
        }*/

        //获得“确定”按钮
        public WebElement getConfirmBtn(){
            WebElement element = element(Locator.getByLocator("confirmBtn"));
            return element;
        }


        //获取元素列表
        public List<WebElement>  getMarkCategoryList(){
            List<WebElement> list = elements(Locator.getByLocator("markCategoryList"));
            return list;
        }


        //获取第一级标签分类列表
    public List<WebElement> getMarkCategoryLevel0List(){
        List<WebElement> list = elements(Locator.getByLocator("markCategoryLevel0List"));
        return list;
    }



        //获取删除按钮
        public WebElement getMarkCategoryDelBtn(WebElement element1){
            WebElement element = element1.findElement(Locator.getByLocator("mkarkCategoryDelBtn"));
            return element;
        }

        //获取“确定”按钮
        public WebElement getDelOkBtn(){
            WebElement element = element(Locator.getByLocator("markDelOkBtn"));
            return element;
        }



}
